<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .div1 {
            padding: 10px;
            border: 3px solid black;
        }

        .div2 {
            border: 3px solid red;
        }

        .div2 img {
            /* position: absolute; */
            float: left;
            padding: 10px;
        }

        .div2:after {
            content: "23232322";
            /* 虽然伪元素转换成块级元素 但是其content属性还是行内元素
            受到兄弟元素影响使其对齐（左|右）进行环绕 此时需要clear清除浮动 
            使float元素占据的位置显示出来*/
            display: block;
            /* clear清除浮动 */
            clear: left;
        }
    </style>
</head>

<body>
    <div class="div1">
        <img src="https://img.36krcdn.com/20220427/v2_fe674d2293cd47af836693819dc1840d_img_png" alt="">
    </div>
    <div class="div2">
        <img src="https://img.36krcdn.com/20220427/v2_450b492d3bff4b7e8264cf06f1867385_img_png" alt="">
    </div>
</body>

</html>